import { UserInfoService } from '../services/UserInfoService'

export class UserHandler {
  userInfoService: UserInfoService

  init(ipcMain) {
    UserInfoService.getInstance().then((service) => {
      this.userInfoService = service
    })
    ipcMain.handle('user.list', (event, args) => {
      return this.userInfoService.list(args)
    })

    ipcMain.handle('user.add', (event, args) => {
      return this.userInfoService.add(args)
    })
  }
}
